package com.yilin.tms.core.remote;

import com.yilin.tms.core.application.ReturnData;
import com.yilin.tms.core.commons.annotation.NoLoginSecurity;
import com.yilin.tms.core.components.interceptor.ReqProviderInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 远程调用 消息服务
 *
 * @author zhangjinyuan
 * @date 2022/10/30
 */
@FeignClient(name = "message-service-provider", configuration = ReqProviderInterceptor.class)
public interface IMessageRemote {
    /**
     * 发送公共短信
     * 安全防护：需要登录
     */
    @PostMapping(value = "/message/sms/sendPhoneMessage")
    ReturnData<Object> sendPhoneMessage(@RequestParam("phone") String phone, @RequestParam("message") String message);

    //---------------------------------------------------------------------------------------------------------------

    /**
     * 根据用户推送(socket+极光推送)
     */
    @PostMapping(value = "/message/push/sendSystemNotify")
    @NoLoginSecurity
    ReturnData<Object> sendSystemNotify(@RequestParam("toAccountId") String toAccountId, @RequestParam("text") String text, @RequestParam("originalUrl") String originalUrl);

    /**
     * 根据用户推送(socket+极光推送)
     */
    @PostMapping(value = "/message/push/sendOrderNotify")
    @NoLoginSecurity
    ReturnData<Object> sendOrderNotify(@RequestParam("toAccountId") String toAccountId, @RequestParam("text") String text, @RequestParam("originalUrl") String originalUrl);


}
